/**
 * 课程API设置
 */
import {mock} from "@/config";
import {spring} from "@/config";

const BASEURL:string = '/curriculum'
export function postCourseIng() {
    return mock({
        url:''
    })
}

export function postSearchCourse(param:string|number) {
    return mock({
        url: BASEURL+`/searchCourse`,
        method: 'POST',
        data: param
    })
}
// 搜索课程
export function postCurriculumQueryCurriculum(param:{
    curriculumName?:string|undefined,
    curriculumType?:string,
    curriculumNode?:number,
}) {
    return spring({
        url: BASEURL+'/queryCurriculum',
        method: 'POST',
        data: param
    })
}
// 得到所有课程
export function postCurriculumGetAllCurriculumByType(param:{
    pageSize?: number,
    pageNum?: number,
    curriculumType: string,
}) {
    return spring({
        url: BASEURL+'/getAllCurriculumByType',
        method: 'POST',
        data: param
    })
}
// 根据课程id获得课程
export function postCurriculumGetCurriculumById(param:{
    id: number,
}) {
    return spring({
        url: BASEURL+'/getCurriculumById',
        method: 'POST',
        data: param
    })
}
// 课程进度（创建schedule：null/更新）
export function postCurriculumCurriculumPlan(param:{
    curriculumId: number,
    schedule?: number
}){
    return spring({
        url: BASEURL+'/curriculumPlan',
        method: 'POST',
        data: param
    })
}
//  课程进度（查询schedule）单个
export function postCurriculumGetCurriculumSchedule(param:{
    curriculumId: number,
}){
    return spring({
        url: BASEURL+'/getCurriculumSchedule',
        method: 'POST',
        data: param
    })
}
// 获取已经完成的课程
export function postCurriculumGetCurriculumFinish(param:{
    pageSize?: number,
    pageNum?: number,
}){
    return spring({
        url: BASEURL+'/getCurriculumFinish',
        method: 'POST',
        data: param
    })
}
// 获取正在学习中的课程列表
export function postCurriculumGetLearningCurriculum(param:{
    pageSize?: number,
    pageNum?: number,
}){
   return spring({
        url: BASEURL+'/getLearningCurriculum',
        method: 'POST',
        data: param
    })
}
// 获取课程库
export function postCurriculumGetCurriculumBase(param:{
    pageSize?: number,
    pageNum?: number,
}){
    return spring({
        url: BASEURL+'/getCurriculumBase',
        method: 'POST',
        data: param
    })
}

// 创建学习笔记 （content根据AI的返回值进行输入）
export function postCurriculumCreateCurriculumNote(param:{
    curriculumId: number,
    content: string,
    curriculumType: string,
}){
    return spring({
        url: BASEURL+'/createCurriculumNote',
        method: 'POST',
        data: param
    })
}
// 根据学习笔记id获取学习笔记
export function postCurriculumGetCurriculumNoteById(param:{
    id: number,
}){
    return spring({
        url: BASEURL+'/getCurriculumNoteById',
        method: 'POST',
        data: param
    })
}
// 获取学习笔记
export function postCurriculumGetCurriculumNoteList(){
    return spring({
        url: BASEURL+'/getCurriculumNoteList',
        method: 'POST'
    })
}
// 搜索课程笔记
export function postCurriculumQueryCurriculumNote(param:{
    curriculumNoteTitle?: string,
    content?: string,
    curriculumType?: string
}){
    return spring({
        url: BASEURL+'/queryCurriculumNote',
        method: 'POST',
        data: param,
    })
}

